﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace JustCleanIt.DataStructure
{
    [DataContract]
    public class Customer
    {
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string FirstName { get; set; }
        [DataMember]
        public string LastName { get; set; }
        [DataMember]
        public string Email { get; set; }
        [DataMember]
        public string Password { get; set; }
        [DataMember]
        public string Phone { get; set; }

        public Gender Gender { get; set; }
        [DataMember(Name = "Gender")]
        string GenderString
        {
            get { return this.Gender.ToString(); }
            set
            {
                Gender gender;
                this.Gender = Enum.TryParse(value, true, out gender) ? gender : Gender.Male;
            }
        }
        [DataMember]
        public Address[] Address { get; set; }
    }
}